angular.module('app.order')

    .factory('orderService', ["$http", "config", function ($http, config) {

        var baseUrl = config.baseUrl + "/orders";

        var ret = {};

        ret.orderList = function (query) {
            var url = baseUrl;
            return $http.get(url, {params: query});
        };

        ret.confirmOrder = function (orderId) {
            var url = baseUrl + "/" + orderId;
            return $http.put(url);
        };

        ret.remove = function (orderId) {
            var url = baseUrl + "/" + orderId;
            return $http.delete(url);
        };

        return ret;
    }]);